package me.acomma.groot.application.auth;

import me.acomma.groot.domain.user.User;
import me.acomma.groot.domain.user.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class AuthApplicationService {
    @Autowired
    private UserRepository userRepository;

    public AuthorizedUser getAuthorizedUser(String username) {
        User user = userRepository.get(username);
        return new AuthorizedUser(user.getUsername(), user.getPassword());
    }
}
